FHIR © HL7.org  |  Server Home  |  FHIR Server FHIR Server 3.4.11  |  FHIR Version n/a  User: [n/a]

Resource StructureMap/FHIR Server from package hl7.fhir.uv.xver#current (31 ms)

Package hl7.fhir.uv.xver
Type StructureMap
Id Id
FHIR Version R5
Source http://hl7.org/fhir/extensions/https://build.fhir.org/ig/HL7/fhir-cross-version/StructureMap-ProcedureRequestDO3to2.html
Url http://hl7.org/fhir/StructureMap/ProcedureRequestDO3to2
Version 0.1.0
Status active
Date 2024-02-22T03:16:50+00:00
Name ProcedureRequestDO3to2
Title DiagnosticOrder Transforms: R3 to R2
Experimental False
Realm uv
Authority hl7
Description DiagnosticOrderTransformsR3toR2

Resources that use this resource

No resources found


Resources that this resource uses

No resources found



Narrative

Note: links and images are rebased to the (stated) source

/// url = 'http://hl7.org/fhir/StructureMap/ProcedureRequestDO3to2'
/// name = 'ProcedureRequestDO3to2'
/// title = 'DiagnosticOrder Transforms: R3 to R2'
/// status = 'active'

uses "http://hl7.org/fhir/3.0/ProcedureRequest" alias DiagnosticRequest as source
uses "http://hl7.org/fhir/1.0/DiagnosticOrder" alias DiagnosticOrderR2 as target

imports "http://hl7.org/fhir/StructureMap/*3to2"

// in R3, DiagnosticOrder is folded into ProcedureRequest, and there's no easy
// way to tell them apart. it requires special knowledge to decide to convert
// a procedure request back to a DiagnosticOrder, but they are marked with an
// extension in case this helps
group DiagnosticOrder(source src : ProcedureRequest, target tgt : DiagnosticOrderR2) extends DomainResource <<type+>> {
  src.subject -> tgt.subject "DiagnosticOrder-subject";
  src.requester as v then {
    v.agent -> tgt.orderer "DiagnosticOrder-orderer-inner";
  } "DiagnosticOrder-orderer";
  src.identifier -> tgt.identifier "DiagnosticOrder-identifier";
  src.context -> tgt.encounter "DiagnosticOrder-encounter";
  src.reasonCode -> tgt.reason "DiagnosticOrder-reason";
  src.supportingInfo -> tgt.supportingInformation "DiagnosticOrder-supportingInformation";
  src.status where src.intent = 'proposal' -> tgt.status = 'proposed' "DiagnosticOrder-status1";
  src.status where src.intent = 'plan' -> tgt.status = 'planned' "DiagnosticOrder-status2";
  src.status as v where (src.intent != 'proposal') and (src.intent != 'plan') -> tgt.status = translate(v, 'http://hl7.org/fhir/ConceptMap/ProcedureRequest.status-R3toR2', 'code') "DiagnosticOrder-status3";
  src.priority -> tgt.priority "DiagnosticOrder-priority";
  src where src.authoredOn.exists() or src.requester.exists() -> tgt.event as ev then doEvent(src, ev) "DiagnosticOrder-event";
  src where src.code.exists() -> tgt.item as it then doItem(src, it) "DiagnosticOrder-item";
  src.note -> tgt.note "DiagnosticOrder-note";
}

group doEvent(source src, target tgt) {
  src -> tgt.status = 'requested' "event-status";
  src.authoredOn -> tgt.dateTime "event-dateTime";
}

group doItem(source src, target tgt) {
  src.code -> tgt.code "item-code";
}


Source

{
  "resourceType" : "StructureMap",
  "id" : "ProcedureRequestDO3to2",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><pre class=\"fml\">\r\n<span style=\"color: #cc00cc\">/// <b>url</b> = </span><span style=\"color: blue\">'http://hl7.org/fhir/StructureMap/ProcedureRequestDO3to2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'ProcedureRequestDO3to2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'DiagnosticOrder Transforms: R3 to R2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>status</b> = </span><span style=\"color: blue\">'active'</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/3.0/ProcedureRequest<span style=\"color: navy\">&quot; </span><b>alias </b>DiagnosticRequest <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/1.0/DiagnosticOrder<span style=\"color: navy\">&quot; </span><b>alias </b>DiagnosticOrderR2 <b>as </b><b>target</b>\r\n\r\n<b>imports</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/StructureMap/*3to2<span style=\"color: navy\">&quot;\r\n</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">in R3, DiagnosticOrder is folded into ProcedureRequest, and there's no easy</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">way to tell them apart. it requires special knowledge to decide to convert</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">a procedure request back to a DiagnosticOrder, but they are marked with an</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">extension in case this helps</span>\r\n<b>group </b>DiagnosticOrder<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>ProcedureRequest, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>DiagnosticOrderR2<span style=\"color: navy\">)</span><b> extends </b>DomainResource<b> &lt;&lt;type+&gt;&gt;</b><span style=\"color: navy\"> {\r\n</span> src.subject<span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject <i>&quot;DiagnosticOrder-subject&quot;</i><span style=\"color: navy\">;</span>\r\n src.requester<b> as </b><span style=\"color: maroon\">v</span><b> then</b><span style=\"color: navy\"> {\r\n</span> v.agent<span style=\"color: navy\"><b> -&gt; </b></span>tgt.orderer <i>&quot;DiagnosticOrder-orderer-inner&quot;</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span> <i>&quot;DiagnosticOrder-orderer&quot;</i><span style=\"color: navy\">;</span>\r\n src.identifier<span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier <i>&quot;DiagnosticOrder-identifier&quot;</i><span style=\"color: navy\">;</span>\r\n src.context<span style=\"color: navy\"><b> -&gt; </b></span>tgt.encounter <i>&quot;DiagnosticOrder-encounter&quot;</i><span style=\"color: navy\">;</span>\r\n src.reasonCode<span style=\"color: navy\"><b> -&gt; </b></span>tgt.reason <i>&quot;DiagnosticOrder-reason&quot;</i><span style=\"color: navy\">;</span>\r\n src.supportingInfo<span style=\"color: navy\"><b> -&gt; </b></span>tgt.supportingInformation <i>&quot;DiagnosticOrder-supportingInformation&quot;</i><span style=\"color: navy\">;</span>\r\n src.status<b> where </b>src.intent = 'proposal'<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <span style=\"color: blue\">'proposed'</span> <i>&quot;DiagnosticOrder-status1&quot;</i><span style=\"color: navy\">;</span>\r\n src.status<b> where </b>src.intent = 'plan'<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <span style=\"color: blue\">'planned'</span> <i>&quot;DiagnosticOrder-status2&quot;</i><span style=\"color: navy\">;</span>\r\n src.status<b> as </b><span style=\"color: maroon\">v</span><b> where </b>(src.intent != 'proposal') and (src.intent != 'plan')<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">v</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'http://hl7.org/fhir/ConceptMap/ProcedureRequest.status-R3toR2'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span> <i>&quot;DiagnosticOrder-status3&quot;</i><span style=\"color: navy\">;</span>\r\n src.priority<span style=\"color: navy\"><b> -&gt; </b></span>tgt.priority <i>&quot;DiagnosticOrder-priority&quot;</i><span style=\"color: navy\">;</span>\r\n src<b> where </b>src.authoredOn.exists() or src.requester.exists()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.event<b> as </b><span style=\"color: maroon\">ev</span><b> then </b>doEvent<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">ev</span><span style=\"color: navy\">)</span> <i>&quot;DiagnosticOrder-event&quot;</i><span style=\"color: navy\">;</span>\r\n src<b> where </b>src.code.exists()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.item<b> as </b><span style=\"color: maroon\">it</span><b> then </b>doItem<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">it</span><span style=\"color: navy\">)</span> <i>&quot;DiagnosticOrder-item&quot;</i><span style=\"color: navy\">;</span>\r\n src.note<span style=\"color: navy\"><b> -&gt; </b></span>tgt.note <i>&quot;DiagnosticOrder-note&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>doEvent<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span> src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <span style=\"color: blue\">'requested'</span> <i>&quot;event-status&quot;</i><span style=\"color: navy\">;</span>\r\n src.authoredOn<span style=\"color: navy\"><b> -&gt; </b></span>tgt.dateTime <i>&quot;event-dateTime&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>doItem<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span> src.code<span style=\"color: navy\"><b> -&gt; </b></span>tgt.code <i>&quot;item-code&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  },
  "extension" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode" : "fhir"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger" : 1,
      "_valueInteger" : {
        "extension" : [
          {
            "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"
          }
        ]
      }
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode" : "draft",
      "_valueCode" : {
        "extension" : [
          {
            "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"
          }
        ]
      }
    }
  ],
  "url" : "http://hl7.org/fhir/StructureMap/ProcedureRequestDO3to2",
  "version" : "0.1.0",
  "name" : "ProcedureRequestDO3to2",
  "title" : "DiagnosticOrder Transforms: R3 to R2",
  "status" : "active",
  "date" : "2024-02-22T03:16:50+00:00",
  "publisher" : "HL7 International / FHIR Infrastructure",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "description" : "DiagnosticOrderTransformsR3toR2",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/3.0/ProcedureRequest",
      "mode" : "source",
      "alias" : "DiagnosticRequest"
    },
    {
      "url" : "http://hl7.org/fhir/1.0/DiagnosticOrder",
      "mode" : "target",
      "alias" : "DiagnosticOrderR2"
    }
  ],
  "import" : [
    "http://hl7.org/fhir/StructureMap/*3to2"
  ],
  "group" : [
    {
      "name" : "DiagnosticOrder",
      "extends" : "DomainResource",
      "typeMode" : "type-and-types",
      "documentation" : "in R3, DiagnosticOrder is folded into ProcedureRequest, and there's no easy\r\nway to tell them apart. it requires special knowledge to decide to convert\r\na procedure request back to a DiagnosticOrder, but they are marked with an\r\nextension in case this helps",
      "input" : [
        {
          "name" : "src",
          "type" : "ProcedureRequest",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "DiagnosticOrderR2",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "DiagnosticOrder-subject",
          "source" : [
            {
              "context" : "src",
              "element" : "subject",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "subject",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-orderer",
          "source" : [
            {
              "context" : "src",
              "element" : "requester",
              "variable" : "v"
            }
          ],
          "rule" : [
            {
              "name" : "DiagnosticOrder-orderer-inner",
              "source" : [
                {
                  "context" : "v",
                  "element" : "agent",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "orderer",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-identifier",
          "source" : [
            {
              "context" : "src",
              "element" : "identifier",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "identifier",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-encounter",
          "source" : [
            {
              "context" : "src",
              "element" : "context",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "encounter",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-reason",
          "source" : [
            {
              "context" : "src",
              "element" : "reasonCode",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "reason",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-supportingInformation",
          "source" : [
            {
              "context" : "src",
              "element" : "supportingInfo",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "supportingInformation",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-status1",
          "source" : [
            {
              "context" : "src",
              "element" : "status",
              "condition" : "src.intent = 'proposal'"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "proposed"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-status2",
          "source" : [
            {
              "context" : "src",
              "element" : "status",
              "condition" : "src.intent = 'plan'"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "planned"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-status3",
          "source" : [
            {
              "context" : "src",
              "element" : "status",
              "variable" : "v",
              "condition" : "(src.intent != 'proposal') and (src.intent != 'plan')"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "status",
              "transform" : "translate",
              "parameter" : [
                {
                  "valueId" : "v"
                },
                {
                  "valueString" : "http://hl7.org/fhir/ConceptMap/ProcedureRequest.status-R3toR2"
                },
                {
                  "valueString" : "code"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-priority",
          "source" : [
            {
              "context" : "src",
              "element" : "priority",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "priority",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-event",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.authoredOn.exists() or src.requester.exists()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "event",
              "variable" : "ev"
            }
          ],
          "dependent" : [
            {
              "name" : "doEvent",
              "parameter" : [
                {
                  "valueId" : "src"
                },
                {
                  "valueId" : "ev"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-item",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.code.exists()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "item",
              "variable" : "it"
            }
          ],
          "dependent" : [
            {
              "name" : "doItem",
              "parameter" : [
                {
                  "valueId" : "src"
                },
                {
                  "valueId" : "it"
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticOrder-note",
          "source" : [
            {
              "context" : "src",
              "element" : "note",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "note",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "doEvent",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "event-status",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "requested"
                }
              ]
            }
          ]
        },
        {
          "name" : "event-dateTime",
          "source" : [
            {
              "context" : "src",
              "element" : "authoredOn",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "dateTime",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "doItem",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "item-code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

XIG built as of ??metadata-date??. Found ??metadata-resources?? resources in ??metadata-packages?? packages.